<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2 onclick="this.color('red')">qwerqwer</h2>
    <h1 onclick="this.hide()">qwerqwer</h1>
    <script>
        let h2 = document.querySelector('h2');
        let h1 = document.querySelector('h1');

        // h2.__proto__ = Object.assign(h2.__proto__, {
        //     color(color) {
        //         this.style.color = color;
        //     }, 
        //     hide() {
        //         this.style.display = 'none';
        //     }
        // })
        Node.prototype = Object.assign(Node.prototype, {
            color(color) {
                this.style.color = color;
            }, 
            hide() {
                this.style.display = 'none';
            }
        })
        // h2.__proto__.color = function (color) {
        //     this.style.color=color;
        // }
    </script>
</body>

</html>